Skip to content

Conversation

@dorezyuk
Copy link
Contributor

@dorezyuk dorezyuk commented Jan 21, 2026

Currently we run init and diagnostics on every start up - until the successfully_configure flag is set. While being a simple logic this results in lots of unnecessary transactions (inti and diagnostics are transactions from the view of the payment provider backend and 1. cost money and 2. can overload the payment provider backend).

The idea is to query the payment terminal (status inquiry, which is fast and does not result in calls to the payment provider backend) and based on the return code to reason if we need to run the aforementioned commands.

The status inquiry returns the terminal_status_code, which is defined under chapter 11 of zvt.

Dima Dorezyuk added 2 commits January 21, 2026 17:22
Signed-off-by: Dima Dorezyuk <[email protected]>
@dorezyuk dorezyuk force-pushed the feat/update_configure_logic branch from 7d4e408 to a173fd5 Compare January 23, 2026 07:40
Copy link

@hovinen hovinen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might need you to walk me through some of these changes, since I'm not so familiar with all of the components involved.

}
constants::TerminalStatusCode::ReconciliationRequired => {
info!("Reconciliation required, running end of day");
self.end_of_day().await?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We wouldn't know a failure occurred here, since end_of_day doesn't log failure. Do we want to add some failure log there, here, or log the error when calling configure? Same goes for failure of set_terminal_id, initialize, and run_diagnosis below.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better yet - since if this function fails we won't have a working PT on a pole, better log it in the calling function and add an alert for this failure to track it

Copy link

@hovinen hovinen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM based on our discussion yesterday. Please see also my comments.

Dima Dorezyuk added 2 commits February 3, 2026 10:42
Signed-off-by: Dima Dorezyuk <[email protected]>
Signed-off-by: Dima Dorezyuk <[email protected]>
@dorezyuk dorezyuk force-pushed the feat/update_configure_logic branch from bfe2f3e to b76ab59 Compare February 3, 2026 13:19
@dorezyuk dorezyuk merged commit 3eca21e into main Feb 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants